<template>
	<view class="container top-padding-container">
		<image class="seeker-bg" src="/static/seeker-home/bg.png"></image>
		<view class="back-btn-box">
			<view class="back-btn" @click="backToPrevPage">
				<up-icon name="arrow-left" color="#333333" size="18"></up-icon>
			</view>
		</view>
		<view class="content-box">
			<!-- <view class="content">{{ detailData.content }}</view> -->
		</view>
	</view>
</template>

<script lang="ts" setup>
import { onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import API from "@/api/index";
defineOptions({
	name: "SeekerHomeDetail",
});

// 当前详情的id
const id = ref<string | number>("");

// 当前详情页数据
const detailData = ref<Partial<API.SolverDetailResponse>>({});

interface NavigatorOptions {
	id: string | number;
}

onLoad((query) => {
	id.value = (query as NavigatorOptions).id;
	getDetail();
});

// 根据id获取详情
const getDetail = () => {
	API.seekerDetail.querySolverDetail(id.value).then((res) => {
		detailData.value = res.data || {};
	});
};

// 返回上一级页面
const backToPrevPage = () => {
	uni.navigateBack();
};
</script>

<style lang="scss" scoped>
.container {
	position: relative;

	.seeker-bg {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 0;
	}

	.back-btn-box {
		width: 100%;
		margin-bottom: 20px;

		.back-btn {
			padding: 0 $base-padding;
			overflow: hidden;
		}
	}
}
</style>
